#ifndef SYS_CONFIG_H
#define SYS_CONFIG_H


//网络ID
#define DEFAULT_NET_ID         0xFFFF    //未分配时默认的网络ID
#define BROADCAST_NET_ID       0x0000    //广播时的NET_ID

//设备ID
#define DEFAULT_DEV_ID         MASTER_DEV_ID//0xFFFF    //主机默认的设备ID
#define MASTER_DEV_ID          0xFFFE    //主机的设备ID


//网络ID
enum
{
    NET_ID_0 = 0,
    NET_ID_1,
    NET_ID_2,
    NET_ID_3,
};

//信道号
enum
{
    CHANNEL_ONE = 1,
    CHANNEL_TWO,
    CHANNEL_THREE,
    CHANNEL_FOUR,

    CHANNEL_ALL,
};

//串口波特率
enum
{
    BAUDRATE_9600 = 1,
    BAUDRATE_19200,
    BAUDRATE_38400,
    BAUDRATE_115200,

    BAUDRATE_NONE,
};

//设备角色定义
#define MASTER_ROLE                 0x0001           //主机角色
#define SLAVER_ROLE                 0x0002           //从机角色
#define COORDINATE_ROLE             0x0003           //协调器角色

//无线设备物理层
enum
{
    PHY_433MHZ_MODULE = 1,           //433模块
    PHY_2_4GHZ_MODULE,              //2.4G模块

    PHY_ALL_MODULE,
};

//当前设备类型
enum
{
    DEV_TYPE_NONE = 0,
    DEV_TYPE_ARM_EXTERN,
    DEV_TYPE_WIRELESS_BOARD,
    DEV_TYPE_KEY_RGB_RELAY,
    DEV_TYPE_DHT11_OLED,

    DEV_TYPE_ALL
};



//系统设置信息
typedef struct str_sys_config
{
    unsigned short net_id;                   //网络id
    unsigned short dev_id;                   //设备id
    unsigned short master_id;                //主机id
    unsigned short baudrate;                 //波特率
    unsigned short channel;                  //信道
    unsigned short dev_phy;                  //无线模块
    unsigned short dev_role;                 //设备角色
    unsigned short dev_type;                 //设备类型
    unsigned short param_flag;               //参数写入标志位
}sys_config_t;



#endif // SYS_CONFIG_H
